#include "dsp.h"
#include "main.h"
static unsigned char seg_com = 0;
unsigned char dot_com = 255;
unsigned char buffer[8] = {0};
code unsigned char seg_buffer[20] = {0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90,0x88,0x83,0xC6,0xA1,0x86,0x8E,0xff,0xc7,0x8c,0xbf};

void seg_display(void)
{
	SEG(0xff);
	COM(0x01<<seg_com);
	if(dot_com == seg_com)
	{
		SEG(seg_buffer[buffer[seg_com]]&0x7f);
	}
	else
	{
		SEG(seg_buffer[buffer[seg_com]]);
	}
	
	if(++seg_com>=8)
	{
		seg_com = 0;
	}
}